
import React from 'react'
import { connect } from 'dva-no-router'
import { bindActionCreators } from 'redux'

import UI from '../components/examination';

class App extends React.Component {
    componentWillUnmount(){
        const {getClean}=this.props;
        getClean();
    }
  render() {
    return (
      <UI {...this.props}/>
    )
  }
}

const actions = {
  query: (val) => ({type: 'examination/query', payload: val}),
  queryDetail: (val) => ({type: 'examination/queryDetail', payload: val}),
    thisTextChange: (val) => ({type: 'examination/thisTextChange',payload:val}),
  search: () => ({type: 'examination/search'}),
  selectRowData: (val) => ({type: 'examination/selectRowData',payload:val}),
    getClean:() => ({type: 'examination/getClean'}),
};

const mapProps = ({examination}) => ({...examination});

const mapActions = dispatch => ({
  ...bindActionCreators({...actions}, dispatch)
});

export default connect(mapProps, mapActions)(App)